
#SUBDIRS = $(shell find . -type f -name 'Makefile' -exec dirname {} \;)
TEMP_MAKE = build/tmp_make

.PHONY: clean dep


#$(SUBDIRS):
#	make -C $@ clean

clean:
	@rm -f -r build
#	@for i in $(SUBDIRS); do \
#            ($(MAKE) -C $$i clean;) done

dep: $(SUBDIRS)
	@sed '/\#\#\# Dependencies/q' < Makefile > $(TEMP_MAKE)
	@(for i in *.c;do \
	  printf `echo $$i | sed 's,\.c,\.s,'`" "; \
	  $(CPP) -M $$i; done) \
	  >> $(TEMP_MAKE)
	@cp $(TEMP_MAKE) Makefile
#	@for i in $(SUBDIRS); do \
#            ($(MAKE) -C $$i dep) done
